/**
 * Created by Kenko on 2014/9/14.
 */

var Conduit = cc.Sprite.extend({

    type: 0,
    column: 0,
    row: 0,
    canRotate:true,

    ctor: function (type, column, row) {
        switch(type){
            case 1:this._super("res/"+Constant.theme+"/curly.png");this.rotation=0;break;
            case 2:this._super("res/"+Constant.theme+"/curly.png");this.rotation=90;break;
            case 3:this._super("res/"+Constant.theme+"/curly.png");this.rotation=180;break;
            case 4:this._super("res/"+Constant.theme+"/curly.png");this.rotation=270;break;
            case 5:this._super("res/"+Constant.theme+"/straight.png");this.rotation=0;break;
            case 6:this._super("res/"+Constant.theme+"/straight.png");this.rotation=90;break;
            default : this._super("res/"+Constant.theme+"/curly.png");this.rotation=0;break;
        }
        this.init(type, column, row);
    },

    init: function (type, column, row) {
        this.type = type;
        this.column = column;
        this.row = row;
    }
});


Conduit.createRandomType = function (column, row) {
    return new Conduit(Math.ceil(Math.random()*6), column, row);
};